﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace Dynamics.NAV.Metro.Data
{
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public class NavGLAccount
    {
        public int Index;

        [XmlElementAttribute("No")]
        public string No { get; set; }
        
        [XmlElementAttribute("Name")]
        public string Name { get; set; }

        public string NameIndented
        {
            get
            {
                string prefix = string.Empty;
                for (int i = 0; i < Indentation; i++)
                    prefix = prefix + "  ";
                return prefix + Name;
            }
        }

        [XmlElementAttribute("Net_Change")]
        public double NetChange{ get; set; }

        [XmlElementAttribute("Balance")]
        public double Balance { get; set; }

        [XmlElementAttribute("Indentation")]
        public int Indentation { get; set; }

        [XmlElementAttribute("Account_Type")]
        public string AccountType { get; set; }

        [XmlElementAttribute("Totaling")]
        public string Totaling { get; set; }

        [XmlElementAttribute("Gen_Posting_Type")]
        public string GenPostingType { get; set; }

        [XmlElementAttribute("Gen_Bus_Posting_Group")]
        public string GenBusPostingGroup { get; set; }

        [XmlElementAttribute("Gen_Prod_Posting_Group")]
        public string GenProdPostingGroup { get; set; }
    }
}
